package com.jt.controller;

import com.alibaba.dubbo.config.annotation.Reference;
import com.jt.service.ItemCatService;
import com.jt.vo.EasyUITree;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/item/cat")
public class ItemCatController {
    @Reference
    private ItemCatService itemCatService;

    @RequestMapping("/queryItemName")
    public String findItemCatNameById(Long itemCatId){
        return itemCatService.findItemCatName(itemCatId);
    }

    @RequestMapping("/list")
    public List<EasyUITree> findItemCatList(Long id){
        Long parentId=(id==null)?0:id;
        return itemCatService.findItemCatList(parentId);
//        return itemCatService.findItemCatCache(parentId);
    }
}
